#[derive(Debug)]
pub struct Error;

impl From<serde_json::Error> for Error {
    fn from(err: serde_json::Error) -> Self {
        eprintln!("Serde error: {err}");
        Self
    }
}

impl From<toml::de::Error> for Error {
    fn from(err: toml::de::Error) -> Self {
        eprintln!("TOML error: {err}");
        Self
    }
}

impl From<toml::ser::Error> for Error {
    fn from(err: toml::ser::Error) -> Self {
        eprintln!("TOML error: {err}");
        Self
    }
}

impl From<std::string::FromUtf8Error> for Error {
    fn from(err: std::string::FromUtf8Error) -> Self {
        eprintln!("Utf8 error: {err}");
        Self
    }
}

impl From<std::io::Error> for Error {
    fn from(err: std::io::Error) -> Self {
        eprintln!("IO error: {err}");
        Self
    }
}

impl From<base64::DecodeError> for Error {
    fn from(err: base64::DecodeError) -> Self {
        eprintln!("Base64 decode error: {err}");
        Self
    }
}

impl From<rsa::Error> for Error {
    fn from(err: rsa::Error) -> Self {
        eprintln!("RSA error: {err}");
        Self
    }
}

impl From<rsa::pkcs8::Error> for Error {
    fn from(err: rsa::pkcs8::Error) -> Self {
        eprintln!("RSA error: {err}");
        Self
    }
}

impl From<rsa::pkcs8::spki::Error> for Error {
    fn from(err: rsa::pkcs8::spki::Error) -> Self {
        eprintln!("RSA error: {err}");
        Self
    }
}
